Skip to content

Add an endpoint filtering the elements a user can access - #267

Open
flomillot wants to merge 7 commits into
mainfrom
feat/batch-element-permissions
Open

Add an endpoint filtering the elements a user can access#267
flomillot wants to merge 7 commits into
mainfrom
feat/batch-element-permissions

Conversation

@flomillot

@flomillot flomillot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The user groups are now resolved once for the whole batch rather than once per element. The unitary path is unchanged.

Consumed by gridsuite/explore-server#209.

The existing /elements/authorized answers all-or-nothing: a single
forbidden element denies the whole request. Resolving the permissions of
several independent elements therefore took one call each.

The new /elements/permission returns which of the given elements the user
may access, leaving out the forbidden and the unknown ones. The user
groups are resolved once for the whole batch instead of once per element.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 32e23036-ff38-41e7-9afb-fcf9349ca3a6


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/main/java/org/gridsuite/directory/server/DirectoryController.java Outdated
Comment thread src/main/java/org/gridsuite/directory/server/DirectoryController.java Outdated
Comment thread src/main/java/org/gridsuite/directory/server/DirectoryController.java Outdated
Comment thread src/main/java/org/gridsuite/directory/server/services/PermissionService.java Outdated
Comment thread src/main/java/org/gridsuite/directory/server/services/PermissionService.java Outdated
The endpoint returns elements, not a permission, which its name now reflects.
Its operation and response descriptions are aligned with the explore-server
endpoint fronting it, which described the same thing in other words.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
userGroupIds already names a resolved List<UUID> a few lines above - the very
list the lambda passed here captures - while this parameter is the Supplier
deferring that resolution.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants